package com.spring.example.rocket;

import java.io.Serializable;
import java.util.Date;
import java.util.UUID;

/**
 * author: xiaochi
 * date: 2025/9/30
 */
public class MqMessage<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 消息ID
     */
    private String messageId = UUID.randomUUID().toString().replace("-", "");

    /**
     * 消息主题
     */
    private String topic;

    /**
     * 消息标签
     */
    private String tag;

    /**
     * 业务键
     */
    private String businessKey;

    /**
     * 消息体
     */
    private T body;

    /**
     * 发送时间
     */
    private Date sendTime = new Date();

    /**
     * 延迟级别
     */
    private Integer delayLevel;

    /**
     * 重试次数
     */
    private Integer retryTimes = 0;

    public MqMessage() {
    }

    public MqMessage(String topic) {
        this.topic = topic;
    }

    public String getMessageId() {
        return messageId;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public String getBusinessKey() {
        return businessKey;
    }

    public void setBusinessKey(String businessKey) {
        this.businessKey = businessKey;
    }

    public T getBody() {
        return body;
    }

    public void setBody(T body) {
        this.body = body;
    }

    public Date getSendTime() {
        return sendTime;
    }

    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }

    public Integer getDelayLevel() {
        return delayLevel;
    }

    public void setDelayLevel(Integer delayLevel) {
        this.delayLevel = delayLevel;
    }

    public Integer getRetryTimes() {
        return retryTimes;
    }

    public void setRetryTimes(Integer retryTimes) {
        this.retryTimes = retryTimes;
    }
}
